package org.session.model;

import java.io.Serializable;

/**
 * An immutable candidate for Session persistence.
 */
public final class SessionEntry implements Serializable {
    private static final long serialVersionUID = 1L;
    private String key; // TODO: may need to specify upper-bound on key-length
    private Object value; // TODO: may need to specify upper-bound
    private int expirySeconds; // do we need a sensible default?

    // If value is not Serializable, it might not be fully persisted
    public SessionEntry(String key, Object value, int expirySeconds) {
        this.key = key;
        this.value = value;
        this.expirySeconds = expirySeconds;
    }

    public String getKey() {
        return key;
    }

    public Object getValue() {
        return value;
    }

    public int getExpirySeconds() {
        return expirySeconds;
    }

}
